
    using SmartSoft.DAL;
    using System.Web.Services;
    using System;
    using System.Data;
    using System.Data.SqlClient;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class WSDmPBCTDataAccess : System.Web.Services.WebService
{
    private DmPBCTDataAccess objDataAccess = new DmPBCTDataAccess();
    public WSDmPBCTDataAccess()
{
}


    [WebMethod]
    public void CreateInvoice(string ps_Subsidiary, object pd_Ngay_Ct, object ps_Dien_Giai, object ps_Desc_EN, object ps_Ma_Tte, object ps_UserName, object pi_Posted, object pb_Locked, DataTable poDetail)
{
object[] arr = Validator.Validate(pd_Ngay_Ct, ps_Dien_Giai, ps_Desc_EN, ps_Ma_Tte, ps_UserName, pi_Posted, pb_Locked);
objDataAccess.CreateInvoice(ps_Subsidiary, arr[0], arr[1], arr[2], arr[3], arr[4], arr[5], arr[6], poDetail);
}



    [WebMethod]
    public DataSet GetDataSet(string ps_Subsidiary, object ps_Loai_PB)
{
object[] arr = Validator.Validate(ps_Loai_PB);
return objDataAccess.GetDataSet(ps_Subsidiary, arr[0]);
}

    [WebMethod]
    public DataTable GetDetailTableHS(object ps_KeyCode)
{
object[] arr = Validator.Validate(ps_KeyCode);
return objDataAccess.GetDetailTableHS(arr[0]);
}

    [WebMethod]
    public DataTable GetTablePB(string ps_Subsidiary, object pd_Ngay_Ct1, object pd_Ngay_Ct2, object pi_KeyCode, ref object pi_TTien0, ref object pi_TTien1)
{
object[] arr = Validator.Validate(pd_Ngay_Ct1, pd_Ngay_Ct2, pi_KeyCode);
return objDataAccess.GetTablePB(ps_Subsidiary, arr[0], arr[1], arr[2], ref  pi_TTien0, ref  pi_TTien1);
}

    [WebMethod]
    public DataTable PhanBo_GTCT(string ps_Subsidiary, object pd_Ngay_Ct1, object pd_Ngay_Ct2, object pi_SPBID, ref object pi_TTien0, ref object pi_TTien1)
{
object[] arr = Validator.Validate(pd_Ngay_Ct1, pd_Ngay_Ct2, pi_SPBID, pi_TTien0, pi_TTien1);
return objDataAccess.PhanBo_GTCT(ps_Subsidiary, arr[0], arr[1], arr[2], ref  pi_TTien0, ref  pi_TTien1);
}

    [WebMethod]
    public int PhanBo_HSCT(string ps_Subsidiary, object pd_Ngay_Ct1, object pd_Ngay_Ct2, object pi_SPBID, object ps_UserName)
{
object[] arr = Validator.Validate(pd_Ngay_Ct1, pd_Ngay_Ct2, pi_SPBID, ps_UserName);
return objDataAccess.PhanBo_HSCT(ps_Subsidiary, arr[0], arr[1], arr[2], arr[3]);
}

    [WebMethod]
    public int PhanBo_TLCT(string ps_Subsidiary, object pd_Ngay_Ct1, object pd_Ngay_Ct2, object pi_SPBID, object ps_UserName)
{
object[] arr = Validator.Validate(pd_Ngay_Ct1, pd_Ngay_Ct2, pi_SPBID, ps_UserName);
return objDataAccess.PhanBo_TLCT(ps_Subsidiary, arr[0], arr[1], arr[2], arr[3]);
}

    [WebMethod]
    public int PhanBo_TTCT(string ps_Subsidiary, object pd_Ngay_Ct1, object pd_Ngay_Ct2, object pi_SPBID, object ps_UserName)
{
object[] arr = Validator.Validate(pd_Ngay_Ct1, pd_Ngay_Ct2, pi_SPBID, ps_UserName);
return objDataAccess.PhanBo_TTCT(ps_Subsidiary, arr[0], arr[1], arr[2], arr[3]);
}


    [WebMethod]
    public int SaveRow(bool pb_NewChecked, DataTable tableRow)
{

return objDataAccess.SaveRow(pb_NewChecked, tableRow.Rows[0]);
}

    [WebMethod]
    public bool SaveRowHS(bool pb_NewChecked, DataTable po_MasterDataRow, DataTable po_DetailDataTable)
{

return objDataAccess.SaveRowHS(pb_NewChecked, po_MasterDataRow.Rows[0], po_DetailDataTable);
}


    [WebMethod]
    public bool SaveTablePB(string ps_Subsidiary, object pd_Ngay_Ct1, object pd_Ngay_Ct2, object po_MasterKey, DataTable po_DetailTable)
{
object[] arr = Validator.Validate(pd_Ngay_Ct1, pd_Ngay_Ct2, po_MasterKey);
return objDataAccess.SaveTablePB(ps_Subsidiary, arr[0], arr[1], arr[2], po_DetailTable);
}
}
